package huzh.foundation.dao;

import java.io.Serializable;

import javax.sql.DataSource;

import huzh.foundation.pool.PoolManager;
import huzh.foundation.pool.connectionpool.ConnectionPool;

/**
 *<p>title:DatabaseDomain</p>
 *<p>description:</p>
 * @since 2014-6-8
 * @author huzh
 * @version 1.0
 */
public class DatabaseDomain  implements Serializable{
    /**serialVersionUID*/
    private static final long serialVersionUID = 3084263475241640000L;
    /**name*/
    private String name;
    /**driver*/
    private String driver;
    /**url*/
    private String url;
    /**user*/
    private String user;
    /**password*/
    private String password;
    /**dataSourceName*/
    private String dataSourceName;
    /**description*/
    private String description;
    /**inited*/
    private boolean inited = false;
    /**dataSource*/
    private DataSource dataSource;
    /**connectChannel*/
    private String connectChannel;
    /**jdlsConnectionPoolName*/
    private String jdlsConnectionPoolName;
    /**app_charset*/
    private String app_charset;
    /**db_charset*/
    private String db_charset;
    /**batchCommit*/
    private int batchCommit = 100;

    /**
     * @return name
     */
    public String getName(){
        return this.name;
    }

    /**
     * @param name
     */
    public void setName(String name) {
      this.name = name;
    }

    /**
     * @return driver
     */
    public String getDriver() {
        return this.driver;
    }

    /**
     * @param driver
     */
    public void setDriver(String driver) {
        this.driver = driver;
    }

    /**
     * @return
     */
    public String getUrl() {
        return this.url;
    }

    /**
     * @param url
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * @return
     */
    public String getUser() {
        return this.user;
    }

    /**
     * @param user
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * @return
     */
    public String getPassword() {
        return this.password;
    }

    /**
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return
     */
    public String getDataSourceName() {
        return this.dataSourceName;
    }

    /**
     * @param dataSourceName
     */
    public void setDataSourceName(String dataSourceName) {
        this.dataSourceName = dataSourceName;
    }

    /**
     * @return description
     */
    public String getDescription() {
        return this.description;
    }

    /**
     * @param description
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return
     */
    public boolean isInited() {
        return this.inited;
    }

    /**
     * @param inited
     */
    public void setInited(boolean inited) {
        this.inited = inited;
    }

    /**
     * @return dataSource
     */
    public DataSource getDataSource() {
        return this.dataSource;
    }

    /**
     * @param dataSource
     */
    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    /**
     * @return
     */
    public String getConnectChannel() {
        return this.connectChannel;
    }

    /**
     * @param connectChannel
     */
    public void setConnectChannel(String connectChannel) {
        this.connectChannel = connectChannel;
    }

    /**
     * @return
     */
    public String getJdlsConnectionPoolName() {
        return this.jdlsConnectionPoolName;
    }

    /**
     * @param jdlsConnectionPoolName
     */
    public void setJdlsConnectionPoolName(String jdlsConnectionPoolName) {
        this.jdlsConnectionPoolName = jdlsConnectionPoolName;
    }

    /**
     * @return
     */
    public ConnectionPool getJdlsConnectionPool(){
        return PoolManager.getPoolManagerInstance().getConnectionPool(this.jdlsConnectionPoolName);
    }

    /**
     * @return
     */
    public String getApp_charset() {
        return this.app_charset;
    }
    /**
     * @param app_charset
     */
    public void setApp_charset(String app_charset) {
        this.app_charset = app_charset;
    }
    /**
     * @return
     */
    public String getDb_charset() {
        return this.db_charset;
    }
    /**
     * @param db_charset
     */
    public void setDb_charset(String db_charset) {
        this.db_charset = db_charset;
    }

    /**
     * @return
     */
    public int getBatchCommit() {
        return this.batchCommit;
    }

    /**
     * @param batchCommit
     */
    public void setBatchCommit(int batchCommit) {
        this.batchCommit = batchCommit;
    }
}
